<?php
/**
 * Dependency instances analyzer
 *
 * PHP version 5
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
require_once 'W/Dependency/Analyzer/Abstract.php';
/**
 * Dependency instances analyzer
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
class W_Dependency_Analyzer_Instances extends W_Dependency_Analyzer_Abstract
{
    public function compute($data,$root)
    {
        $d = array();
        foreach($data as $file=>$info) {
            foreach(array('new') as $key) {
                if (true === isset($info[$key])) {
                    $this->updateDependencies($d,$file,$info[$key],$root);
                }
            }
        }
        return $d;
    }
}